package com.xxx.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @version v1.0
 * @Description:
 * @Author zhanzhongxin
 * @Date 2021/8/4 14:09
 * @Copyright 博为峰
 */
public class StudentServlet extends BaseServlet {

//    @Override
//    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        final String method = req.getParameter("method");
//        if(method.equals("addStu")){
//            addStu(req,resp);
//        }else if(method.equals("queryStu")){
//            queryStu(req,resp);
//        }
//    }

    public String addStu(HttpServletRequest req, HttpServletResponse resp) {
        System.out.println("addStu");
//        req.getRequestDispatcher("success.jsp").forward(req, resp);
        return "forward:/success.jsp";
    }

    public String queryStu(HttpServletRequest req, HttpServletResponse resp) {
        System.out.println("queryStu");
//        resp.sendRedirect("/web02_war_exploded/list.jsp");
        return "redirect:/list.jsp";
    }

    public void deleteStu() {
    }

    public void updateStu() {
    }
}
